package view;


import java.util.ArrayList;
import java.util.TreeSet;
import javax.swing.table.AbstractTableModel;
import model.kwalificatiebeheer.Kerntaak;
import model.kwalificatiebeheer.KwalificatieDossier;
import model.kwalificatiebeheer.KwalificatieDossiers;

public class KerntaakTableModel extends AbstractTableModel{
	
	private String[] columnNames = {"Kerntaken"};
	private TreeSet<Kerntaak> ktList;
	private KwalificatieDossier kd;
	
	public KerntaakTableModel(){}
	public KerntaakTableModel(KwalificatieDossier kd){
		this.kd = kd;
		ktList = kd.getKerntaken();
	}
	
	public String getColumnName(int col) {
		return columnNames[col];
	}
	
	@Override
	public int getColumnCount() {
		return 1;
	}

	@Override
	public int getRowCount() {
		return ktList.size();
	}

	@Override
	public Object getValueAt(int rowIndex, int columnIndex) {
		ArrayList<Kerntaak> list = new ArrayList<Kerntaak>(kd.getKerntaken());
		if(columnIndex==0){
        	return list.get(rowIndex).getTitle();
        }
        return null;
	}

}
